package ${sysTableVo.packageName}.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import ${sysTableVo.packageName}.entity.bo.${sysTableVo.bigClassName}Bo;
import ${sysTableVo.packageName}.entity.vo.${sysTableVo.bigClassName}Vo;
import com.jichangxiu.common.entity.po.BaseEntity;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMappers;
import lombok.*;
import lombok.experimental.Accessors;

#foreach ($import in $importList)
import ${import};
#if($foreach.count == $importList.size())

#end
#end
/**
 * ${sysTableVo.bigClassName}: ${sysTableVo.name} ${sysTableVo.comment}
 *
 * @author ${sysTableVo.functionAuthor}
 * @create ${datetime}
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("${sysTableVo.name}")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@AutoMappers({
    @AutoMapper(target = ${sysTableVo.bigClassName}Bo.class, reverseConvertGenerate = false),
    @AutoMapper(target = ${sysTableVo.bigClassName}Vo.class, reverseConvertGenerate = false)
})
public class ${sysTableVo.bigClassName} extends BaseEntity {

#foreach ($sysColumnVo in $sysColumnVoList)
    #set($parentheseIndex=$sysColumnVo.comment.indexOf("（"))
    #if($parentheseIndex != -1)
        #set($comment=$sysColumnVo.comment.substring(0, $parentheseIndex))
    #else
        #set($comment=$sysColumnVo.comment)
    #end
    #if(!$sysColumnVo.isSuperColumn($sysColumnVo.javaField))
    /**
      * ${comment}
      */
        #if($sysColumnVo.isPrimaryKey)
            #if($sysColumnVo.isIncrement)
    @TableId(value = "${sysColumnVo.name}", type = IdType.AUTO)
            #else
    @TableId(value = "${sysColumnVo.name}", type = IdType.ASSIGN_ID)
            #end
        #end
        #if($sysColumnVo.javaType == 'Date')
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        #end
        #if($sysColumnVo.name == "deleted")
    @TableLogic
    @TableField(value = "${sysColumnVo.name}")
        #end
        #if(!$sysColumnVo.isPrimaryKey && $sysColumnVo.name != "deleted")
            #if($sysColumnVo.isSpecialCharacters($sysColumnVo.javaField))
    @TableField(value = "`${sysColumnVo.name}`")
            #else
    @TableField(value = "${sysColumnVo.name}")
            #end
        #end
    private $sysColumnVo.javaType $sysColumnVo.javaField;

    #end
#end
}
